<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div class="easyui-panel">
		<div style="padding: 10px">
			<form id="frmAccount">
				<input type="hidden" name="account.id" value="${account.id}" />
				<input type="hidden" name="account.userId" value="${account.userId}" />
				<s:set id="accountStatus" value="#{'true':'启用','false':'禁用'}" />
				<table width="100%">
					<tr>
						<td width="25%" align="right"><span>登录帐号：</span></td>
						<td width="75%" align="left"><input class="easyui-validatebox" type="text" name="account.code"
							data-options="required:true" value="${account.code}" style="width: 98%" /></td>
					</tr>
					<tr>
						<td><span>用户名称：</span></td>
						<td><input class="easyui-validatebox" type="text" name="account.name" data-options="required:true"
							value="${account.name}" style="width: 98%" /></td>
					</tr>
					<tr>
						<td><span>登录密码：</span></td>
						<td><input class="easyui-validatebox" type="password" name="account.password" data-options="required:true"
							value="${account.password}" style="width: 98%" /></td>
					</tr>
					<tr>
						<td><span>帐号状态：</span></td>
						<td><s:select list="accountStatus" name="account.enabled" value="account.enabled" theme="simple" cssStyle="width:98%" /></td>
					</tr>
					<tr>
						<td><span>描述：</span></td>
						<td><textarea rows="3" name="account.description" style="width: 98%">${account.description}</textarea></td>
					</tr>
				</table>
			</form>
		</div>
	</div>

	<div style="text-align: center; padding: 5px">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitfrmAccount()">保存</a> <a href="javascript:void(0)"
			class="easyui-linkbutton" onclick="closewinAccount()">关闭</a>
	</div>

	<script type="text/javascript">
		function submitfrmAccount() {
			var issubmit = true;
			$("input.easyui-validatebox").each(function(obj) {
				if ($(this).validatebox("isValid") == false) {
					issubmit = false;
				}
			});
			if (issubmit) {
				var params = $("#frmAccount").serialize();
				$.ajax({
					url : "${path}/system/account/save.do",
					type : "POST",
					data : params,
					dataType : "json",
					success : function(data) {
						if (null != data.message) {
							$.messager.alert("提示信息", data.message);
						} else {
							$.messager.alert("提示信息", "数据保存成功！");
						}
					}
				});
			}
		}
	</script>
</body>
</html>